home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 098 / brooks.arc / ACADLSP.DOC next >
Encoding:
Text File  |  1987-04-21  |  4.2 KB  |  110 lines

  1.  
  2.     
  3.     
  4.         
  5.     DOCUMENTATION OF AUTOLISP COMMAND FUNCTIONS BY ROGER BROOKS
  6.  
  7.         4880 Galley Rd. #228,  Colorado Springs,  CO 80915
  8.  
  9.  
  10.     
  11.     
  12.             
  13.     QTSW
  14.     
  15.     I like to have a special function key to toggle QTEXT mode.
  16.     Since AutoCAD V2.18 does not provide a control character for this
  17.     function as it does for other "toggle" functions, I wrote a
  18.     simple command definition and defined an SFK as "QTSW ".
  19.     
  20.     
  21.     BOX
  22.     
  23.     This appears to be faster and more conservative of space than
  24.     the use of BLOCKs, which is how I used to draw rectangles.  In
  25.     this case I am able to simulate AutoCAD's handling of "point"
  26.     default vs "string" options because (getpoint) will return nil
  27.     if a string is entered instead of a point.  
  28.     
  29.     Unfortunately, V2.18 provides no way to distinguish one string
  30.     from another after a getpoint, hence the separate "CBOX" command.
  31.     There is supposed to be a user-accessible lisp function (initget)
  32.     in AutoCAD V2.6 which supports the full AutoCAD resident command
  33.     style of selecting options by entering various strings in place
  34.     of a default point.
  35.     
  36.     
  37.     CBOX
  38.     
  39.     This would be the third option in BOX if I had access to the
  40.     (initget) function as described above.  Unfortunately, AutoCAD
  41.     beyond V2.18 has not been ported to my machine, a NEC APC.
  42.     
  43.     You will note that this definition, like most described here,
  44.     begins with (setvar "CMDECHO" 0) and ends with (quote Command:).
  45.     The first makes the inner workings of the command function
  46.     transparent to the user, while the second produces the best
  47.     approximation of a new "Command:" prompt available under V2.18
  48.     after execution of a lisp routine.  It actually appears as:
  49.     
  50.     COMMAND:
  51.     *
  52.     
  53.     where the * represents the text cursor position.
  54.  
  55.     
  56.     
  57.     
  58.     
  59.     BUBBLE
  60.     
  61.     Draws a numbered bubble with leader on layer 0.  The shape
  62.     "SQUIGGLE" (in my file CUSTOM.SHP) must be loaded for leaders 
  63.     to be drawn from the interior of objects.  The trignometry is 
  64.     used to second-guess the DIM LEADER function in deciding if a
  65.     horizontal "dog-leg" will be drawn on the end of the leader and
  66.     if so, in what direction.  This makes the use of OSNAP dangerous
  67.     with horizontal leaders unless the bubbled end of the leader is
  68.     specified by a horizontal displacement instead of by picking a
  69.     point.  
  70.     
  71.     The danger is that the line will appear to be horizontal without
  72.     being exactly so, which can lead to a gap between bubble and
  73.     leader.  This may be fixed by introducing a tolerance in a future
  74.     version.  Meanwhile, the use of GRID SNAP is recommended to
  75.     insure that leaders which appear horizontal really are.
  76.         
  77.     
  78.     NOTES
  79.     
  80.     Undoubtedly the most useful of my AutoLISP routines, I wrote
  81.     this in sheer desperation when it turned out that PDWORD had
  82.     been compiled from Turbo PASCAL with IBM specific I/O code.
  83.     As it turns out, NOTES has many advantages over PDWORD; notably,
  84.     it is much smaller and requires no processing outside of AutoCAD
  85.     except the creation of the text file.  
  86.     
  87.     Please remember, however, when creating your text file, that 
  88.     (at least in V2.18) AutoCAD does not support the complete ASCII
  89.     character set.  I found the lack of a TAB character to be a
  90.     particular problem and invented a crude approximation which
  91.     will provide only the first TAB stop at roughly column 9.  If
  92.     anyone can figure out how to do a full set of TABs, I would 
  93.     love to hear about it.
  94.     
  95.     This function inserts text referred to an upper left corner but
  96.     it can be easily expanded after the model of BOX above to include
  97.     a second option if you frequently find yourself including large 
  98.     blocks of centered or right-justified text.  
  99.     
  100.     The vertical line spacing is set to 60% of character height,
  101.     which is within 3% of the default line spacing for all fonts
  102.     supplied with AutoCAD V2.18.  The reason for this is that the
  103.     null command (command "") which is said in the documentation
  104.     to perform like pressing RETURN from the keyboard, cannot be
  105.     used within AutoLISP to repeat a command invoked with the 
  106.     (command) function.  Instead, it repeats the last command
  107.     entered from the keyboard, in this case, NOTES.  Hence it is 
  108.     impossible (at least in V2.18) to use the "repeat last command"
  109.     function to enter text on succeeding lines.
  110.